﻿
Public Module deliverer_creator
    Private Function _wrappered(ByVal i As async_deliverer_t) As deliverer_t
        Return New wrappered_deliverer(i)
    End Function

    Private Function _sync_async(ByVal i As sync_deliverer_t) As async_deliverer_t
        Return New async_deliverer_wrapper(i)
    End Function

    Private Function _locked(ByVal i As async_deliverer_t) As async_deliverer_t
        Return New locked_deliverer_wrapper(i)
    End Function

    Private Function _sequential(ByVal i As async_deliverer_t) As async_deliverer_t
        Return New sequential_deliverer_wrapper(i)
    End Function

    Private Function _sequential_locked(ByVal i As async_deliverer_t) As async_deliverer_t
        Return _sequential(_locked(i))
    End Function

    Public Function sync_async(ByVal i As sync_deliverer_t) As deliverer_t
        Return _wrappered(_sync_async(i))
    End Function

    Public Function locked(ByVal i As async_deliverer_t) As deliverer_t
        Return _wrappered(_locked(i))
    End Function

    Public Function locked(ByVal i As sync_deliverer_t) As deliverer_t
        Return _wrappered(_locked(_sync_async(i)))
    End Function

    Public Function sequential(ByVal i As async_deliverer_t) As deliverer_t
        Return _wrappered(_sequential(i))
    End Function

    Public Function sequential(ByVal i As sync_deliverer_t) As deliverer_t
        Return _wrappered(_sequential(_sync_async(i)))
    End Function

    Public Function sequential_locked(ByVal i As async_deliverer_t) As deliverer_t
        Return _wrappered(_sequential_locked(i))
    End Function

    Public Function sequential_locked(ByVal i As sync_deliverer_t) As deliverer_t
        Return _wrappered(_sequential_locked(_sync_async(i)))
    End Function
End Module
